package cate.common.table.d;

import cate.common.table.common.ParamSheet;
import easy.java.dev.note.NoteClass;
import easy.java.dev.note.NoteField;



@NoteClass(value = "徽章相关")
public class GDRune {

    @NoteField(value = "徽章锻造——熔炼奖励【徽章ID】")
    public static int MELTING_REWARD_TYPE;

    @NoteField(value = "徽章锻造——兑换熔炼奖励所需的熔炼值")
    public static int MELTING_NUM;

    @NoteField(value = "徽章锻造失败——徽章精华返还比例")
    public static double MELTING_FAIL_RETURN_PROPORTION;

    @NoteField(value = "徽章重铸优惠比例")
    public static double RUNE_REFORGE_RATIO;

    @NoteField(value = "徽章突破时需要用到的附属徽章数量")
    public static final int BREAK_NUM = 2;

    @NoteField(value = "徽章突破时徽章的id要求")
    public static final int BREAK_REQUIRE_TID = 5;

    @NoteField(value = "徽章突破后变成的徽章tid")
    public static final int BREAK_TID = 10001;

    @NoteField(value = "徽章突破的消耗")
    public static String BREAK_CONSUME_STR;

    public static int RUNE_ESSENCE_ID = 800102;

    /** 读取excel中配置的参数 */
    public static void initialize(ParamSheet paramSheet) {
        MELTING_REWARD_TYPE = GDParamTool.getInt(paramSheet,701, 4);
        MELTING_NUM = GDParamTool.getInt(paramSheet,702, 1000);
        MELTING_FAIL_RETURN_PROPORTION = GDParamTool.getDouble(paramSheet,705, 0.5);
        RUNE_REFORGE_RATIO = GDParamTool.getDouble(paramSheet,130005, 0.7);
        BREAK_CONSUME_STR = GDParamTool.getString(paramSheet,706, "0:1:100");
    }

    @NoteClass(value = "徽章-重铸方式")
    public static class RecastType {
        @NoteField(value = "基础重铸", detail = "同时重铸技能和属性")
        public static final byte BASE = 0;

        @NoteField(value = "重铸技能", detail = "单独重铸技能")
        public static final byte SKILL = 1;

        @NoteField(value = "重铸属性", detail = "单独重铸属性")
        public static final byte ATTR = 2;

        @NoteField(value = "重铸等级属性", detail = "单独重铸等级属性")
        public static final byte LEVEL_ATTR = 3;

        @NoteField(value = "特殊技能洗练")
        public static final byte SPECIAL_SKILL = 4;

        // 判断此类型是否需要重铸技能
        public static boolean recastSkill(byte type) {
            return type == BASE || type == SKILL || type == SPECIAL_SKILL;
        }

        // 判断此类型是否需要重铸属性
        public static boolean recastAttr(byte type) {
            return type == BASE || type == ATTR;
        }

        // 判断此类型是否需要重铸等级属性
        public static boolean recastLevelAttr(byte type) {
            return type == LEVEL_ATTR;
        }
    }
}
